#include "Brick.h"

namespace sprites
{
	Brick::Brick(Vector3D _pos, MatterType _type, float boundRadius)
		: Sprite(_pos, _type, boundRadius, 1.0f)
	{
		build();
	}
	Brick::Brick(Vector3D _pos, MatterType _type, float boundRadius, float scale)
		: Sprite(_pos, _type, boundRadius, scale)
	{
		build();
	}

	Brick::~Brick()
		{
			root->destroy();
		}

	void Brick::build()
		{
			Cube* cube = new Cube(1.0f, 1.0f, 1.0f, 0xFF010101);
			cube->textured = true;
			cube->setTexture("resources/textures/bricks.jpg");
			root->addChild(cube);
		}


	BindingSphere Brick::getBindingSphere()
	{
		return bound;
	}


	std::vector<BindingSphere> Brick::getBindingShapes()
	{
		vector<BindingSphere> jad = vector<BindingSphere>();
		jad.push_back(bound);
		return jad;
	}
		
	
	void Brick::handleCollision(MatterType oType, BindingSphere sphere)
	{
		switch(oType)
		{
		case collisions::BARRIER:
			break;
		case collisions::SHIPBULLET :
			break;
		case collisions::INVADERBULLET :
			break;
		case collisions::INVADER :
			break;
		case collisions::SHIP :
			break;
		}
	}

	void Brick::destroyed()
	{
		dead = true;
	}
}